class Admin::ShippingMethodsController < Admin::AdminController
  filter_resource_access

  add_crumb("Nastavení", :only => :show) {}
  add_crumb("Nastavení", :admin_setting_path, :except => :show)
  add_crumb("Správa metod doručení", :only => :index) {}
  add_crumb("Správa metod doručení", :admin_shipping_methods_path, :except => :index)

  def index
    @search = ShippingMethod.search(params[:search])
    @shipping_methods = @search.page(params[:page])
  end

  def update
    if @shipping_method.update_attributes(params[:shipping_method])
      redirect_to admin_shipping_methods_path, :notice => "Metoda doručení byla úspěšně uložena."
    else
      render :action => :edit
    end
  end
end
